"""
Interfaces.
"""



from zope.interface import Interface



class INotifiedAgent(Interface):
    """
    A agent able to received notifications about attribute changes and
    method calls.
    """

    def attributeSetNotification(item, name, value):
        """
        Notify a modification of attribute named C{name} to value C{value} of
        given C{item}.
        """


    def methodCallNotification(item, method, args, kwargs, time):
        """
        Notify a method call of method named C{method} of given item.
        """



class IMonitorAgent(INotifiedAgent):
    """
    A monitoring agent.
    """

    def registerConnector(connector):
        """
        Register a connector which will receive future notifications.
        """


    def unregisterConnector(connector):
        """
        Unregister a connector.
        """


    def registerItem(item):
        """
        Register an item to be monitored. If an item subscribe a monitored
        class, this is usually not necessary.
        """



class IMonitorConnector(INotifiedAgent):
    """
    A connector that receive notification from an agent.
    """
